//part1:C03:ex3.10.cpp
// read come charcters, get rid of some marked chars.
#include <iostream>
#include <string>
#include <cctype>

int main(void)
{
    using namespace std;

    string s;
    cout << "Enter a string, with all kinds of chars:\n";
    getline(cin, s);
    for (auto c : s)
    {
        if (!ispunct(c))
        {
            cout << c;
        }
    }
    cout << endl;

    // methods two:
    string result;
    for (decltype(s.size()) i = 0; i < s.size(); i++)
    {
        if (!ispunct(s[i]))
        {
            result += s[i];
        }
    }
    cout << result << endl;
    
    return 0;
}